﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wintellect.PowerCollections;

namespace OperatorsGeneric
{
    class PriorityQueue<T>:IEnumerable<T>
    {
        OrderedBag<T> queue;

        public PriorityQueue()
        {
            this.queue = new OrderedBag<T>();
        }

        public void Enque(T element) 
        {
            queue.Add(element);
        }

        public T this[int index] 
        {
            get 
            {
                return queue[index];
            }
        }


        public IEnumerator<T> GetEnumerator()
        {
            return queue.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return queue.GetEnumerator();
        }
    }
}
